package com.invengo.module_check.ui.fragment.forced.fragment.itemviewmodel;

import androidx.annotation.NonNull;

import com.invengo.library_db.entity.module_check.BookBean;import com.invengo.module_check.ui.fragment.forced.fragment.ForcePosViewModel;

import me.goldze.mvvmhabit.base.ItemViewModel;
import me.goldze.mvvmhabit.binding.command.BindingCommand;
import me.goldze.mvvmhabit.bus.event.SingleLiveEvent;

public class ForcePosByBookItemViewModel extends ItemViewModel<ForcePosViewModel> {
    public SingleLiveEvent<BookBean> book = new SingleLiveEvent<>();

    public ForcePosByBookItemViewModel(@NonNull ForcePosViewModel viewModel, BookBean bean) {
        super(viewModel);
        book.postValue(bean);
    }

    public BindingCommand removeItem = new BindingCommand(() -> {
        viewModel.onItemRemove(this);
    });
    public int getPosition() {
        return viewModel.getPosition(this) + 1;
    }
}
